﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using DAL;
using Model;
using IDAL;
using BLL;

namespace EstateService.Controllers
{
    public class InquiryController : ApiController
    {


        BLL.IFactory<IInquiryDAL, InquiryDAL> bll = new Factory<IInquiryDAL, InquiryDAL>();
        // GET api/inquiry
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

        // GET api/inquiry/5
        public string Get(int id)
        {
            return "value";
        }

        // POST api/inquiry
        public void Post([FromBody]string value)
        {
        }

        // PUT api/inquiry/5
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE api/inquiry/5
        public void Delete(int id)
        {
        }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="mo"></param>
        /// <returns></returns>
        [HttpPost]
        [ActionName("InquiryAdd")]
        public int InquiryAdd(Inquiry mo)
        {
            return bll.Fbi().InquiryAdd(mo);
        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        [HttpGet]
        [ActionName("InquiryShow")]
        public List<Inquiry> InquiryShow(string name)
        {
            return bll.Fbi().InquiryShow(name);
        }
    }
}
